<?php

use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Support\Facades\Schema;

class CreateTableNotes extends Migration {
	/**
	 * Run the migrations.
	 *
	 * @return void
	 */
	public function up() {
		Schema::create('notes', function (Blueprint $table) {
			$table->increments('id');
			$table->string('title', 50)->comment('标题');
			$table->integer('user_id')->comment('创建者id');
			$table->string('briefly', 120)->nullable()->comment('描述');
			$table->string('image', 100)->comment('图片');
			$table->integer('percent')->default(0)->comment('已读数');
			$table->integer('num')->default(0)->comment('总页数');
			$table->boolean('type')->default(false)->comment('阅读中|想读');
			$table->boolean('status')->default(true)->comment('状态')->index();
			$table->index('title');
			$table->timestamps();
			$table->softDeletes();
		});
	}

	/**
	 * Reverse the migrations.
	 *
	 * @return void
	 */
	public function down() {
		Schema::dropIfExists('notes');
	}
}
